package com.forlove.app.manager;


import com.forlove.app.ForloveApplication;
import com.forlove.app.ForloveConfig;
import com.forlove.app.common.utils.AppPreferenceHelper;

/**
 * 所有接口列表
 * Created by yjl on 2017/7/13.
 */

public class ServerManager {


    //    public static final String ServerHost = "https://api.quanyiquan.com";//线上地址
    public static final String ServerHost = "http://api.quanyiquan.com";//线上地址
//    public static final String ServerTest = "http://testapi.quanyiquan.com";  //测试地址

    //    public static final String ServerTest = "https://testapi.quanyiquan.com";
    public static final String ServerTest = "http://testapi.quanyiquan.com";


    public static final String SERVER_PORT = "";

    public static final String ImageUrl = "http://qyqproduct.oss-cn-beijing.aliyuncs.com";  //图片的线上地址

    public static final String ImageUrl_TEST = "http://qyqtest.oss-cn-beijing.aliyuncs.com";  //图片的测试地址

    public static final String ImageUrlEmoji = "http://qyqproduct.oss-cn-beijing.aliyuncs.com/emoji";//emoji替换图片的地址

    /**
     * 获取后台地址
     */
    public static String getServerUrl() {
        if (ForloveConfig.IS_RELEASE) {
            return ServerHost;
        } else {
            return ServerHost_TEST;
        }
    }

    public static String getImageUrl() {
        if (ForloveConfig.IS_RELEASE) {
            return ImageUrl;
        } else {
            return ImageUrl_TEST;
        }
    }


    // 测试后台地址
    public static String ServerHost_TEST = getServerTest();


    /**
     * 获取选择的测试地址
     *
     * @return
     */
    public static String getServerTest() {
        return AppPreferenceHelper.getInstance(ForloveApplication.getInstance())
                .getString(PreferenceKeys.KEY_TEST_SERVER, ServerTest);
    }

    /**
     * 保存测试地址
     *
     * @param serverTest
     */
    public static void saveServerTest(String serverTest) {
        AppPreferenceHelper.getInstance(ForloveApplication.getInstance())
                .putString(PreferenceKeys.KEY_TEST_SERVER, ServerTest);
    }

    public static final String URL_SHORT_LINK = "https://api.weibo.com/2/short_url/shorten.json";//分享地址转换短连接接口

    public static final String ACTION_CLEAR_RECORD = "/resetBatch";//清楚答题记录

    public static final String ACTION_REG_FIRST = "/reg/first";//注册第一步获取手机号是否

    public static final String ACTION_GET_MSG = "/reg/msg"; //获取短息

    public static final String ACTION_REG_STEP1 = "/reg/step/1"; //验证码校验接口

    public static final String ACTION_REG_STEP2 = "/reg/step/2";//注册接口第二步

    public static final String ACTION_LOGIN = "/prelogin";//登录输入手机号判断是否注册

    public static final String ACTION_LOGIN_PW = "/login";//登录输入密码操作

    public static final String ACTION_GET_SUBJECT = "/note/getnew";//获取题目

    public static final String ACTION_ANSWER_SUBJECT = "/note/record";//答题

    public static final String ACTION_LIMIT_LOCATION = "/reg/restrict"; //经纬度判断

    public static final String ACTION_SET_ACCOUNT = "/setUsername";//设置用户名

    public static final String ACTION_UPLOAD_CONTACTS = "/friends/uploadConcat";//上传通讯录

    public static final String ACTION_FRIEND_LIST = "/friends/list";//好友列表

    public static final String ACTION_FRIEND_LIST_NEW = "/friends/listNew";//新的好友列表

    public static final String ACTION_FRIEND_SEARCH = "/friends/searchFriends";  //好友搜索

    public static final String ACTION_FRIEND_ADD_REQUEST = "/friends/addFriends";//好友申请

    public static final String ACTION_NEW_FRIEND = "/friends/news";//新的好友请求

    public static final String ACTION_FRIEND_REQUEST = "/friends/getFriendsRequest";//获取好友请求列表

    public static final String ACTION_AGREE_FRIEND = "/friends/acknowledge";//同意好友请求

    public static final String ACTION_GET_CONTACTS_FRIEND = "/friends/concatList";//获取通讯录注册好友

    public static final String ACTION_GET_INDEX_INFO = "/user/home";//首页获取好友信息和魅力值信息

    public static final String ACTION_PERSON_DETAIL_INFO = "/user/personalPage";//获取个人详细信息

    public static final String ACTION_PERSON_RANKLIST = "/user/userPageDataList";//被圈排行榜

    public static final String ACTION_USER_ANSWER_DETAIL = "/user/activeDetail";//用户答题详情页

    public static final String ACTION_ANSWER_DETAIL_LOCK = "/user/lockRecord";//答题详情页是否枷锁

    public static final String ACTION_UPDATE_USER_INFO = "/user/updateInfo";//更新设置用户信息

    public static final String ACTION_UPLOAD_IMAGE = "/uploadImg";//上传头像

    public static final String ACTION_RESETPW_MSG = "/reg/resetPwdMsg";//重设密码发送短信

    public static final String ACTION_RESET_PW = "/reg/resetPwd";//重设密码

    public static final String ACTION_GET_INFO = "/friends/getActiveFlag";//获取最新消息

    public static final String ACTION_INVITE_FRIEND_BY_SMS = "/user/inviteUserBySms";//短信邀请好友

    public static final String ACTION_UP_REGISTERID = "/registId"; //上传极光id

    public static final String ACTION_UPDATE = "/apppackage/query/last";//版本更新

    public static final String ACTION_RESET_QUESTION = "/note/resetBatch";//重置答题

    public static final String ACTION_DELETE_FRIENDS = "/friends/removeFriends";//删除好友

    public static final String ACTION_REPORT_FRIENDS = "/friends/jubao";//举报好友

    public static final String ACTION_DELETE_FRIEND_RECORD = "/friends/deposeNewFriends";//删除好友申请记录

    public static final String ACTION_ADD_FRIENDS = "/friends/addCandidate";//设置候选人

    public static final String ACTION_CANDIDATE_LIST = "/friends/candidateList";//候选人列表

    public static final String ACTION_GET_SCHOOL = "/user/getAllSchools";//获取学校

    public static final String ACTION_SCHOOL_FRIEND = "/friends/searchFriendsBySchool";//查找学校好友

    public static final String ACTION_GET_OFFICIAL = "/getOfficial";//获取分享微信qq,微博的地址

    public static final String ACTION_SEARCH_SCHOOL = "/user/searchSchoolByLocation";//根据坐标搜索学校
}